<?php
/*
 * @FilePath: 横幅广告验证器
 * @Author: 谭贤伟
 * @Date: 2023-04-01 15:03:56
 * @LastEditors: 
 * @LastEditTime: 2023-04-02 18:52:47
 * @Descripttion: 
 */

namespace app\admin\validate;

use think\Validate;

class Banner extends Validate
{
    protected $rule =   [
        'title'  => 'require|max:20',   
        'banner_img' => 'require'	
    ];
    
    protected $message  =   [
        'title' => '横幅广告标题最多不能超过20个字符',
        'title.require' => '横幅广告标题不能为空',
		'banner_img.require' => '横幅广告图片不能为空'
    ];
	
	protected $scene = [
        'add'  =>  ['title','banner_img'],
        'edit'  =>  ['title','banner_img'],
    ];
    
}